﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WoAssetInfoSelectedCtl.ascx.cs"
    Inherits="AMS.Web.WorkBill.WoAssetInfoSelectedCtl" %>
<%@ Register Assembly="VitCode.Web.UI.PaginationGrid" Namespace="VitCode.Web.UI"
    TagPrefix="PaginationGrid" %>
<%@ Register Assembly="VitCode.Web.UI.ConditionSelector" Namespace="VitCode.Web.UI"
    TagPrefix="cc1" %>
<link href="../ScriptFiles/CSS/Main.css" type="text/css" rel="stylesheet" />
<link href="../ScriptFiles/CSS/style.css" type="text/css" rel="Stylesheet" />
<asp:HiddenField ID="hdnClassName" runat="server" />
<asp:HiddenField ID="hdnTypeName" runat="server" />
<asp:HiddenField ID="hdnKeyVal" runat="server" />
<asp:HiddenField ID="hdnWoCode" runat="server" />
 
<table width="100%" style="border: 1px solid #A8CFEB; margin-top: 4px;" class="tableElse">
    <tr>
        <td>
            <asp:Label ID="lblSelColMemo" runat="server">查询条件：</asp:Label><asp:DropDownList ID="ddlCondition"
                runat="server">
            </asp:DropDownList>
            <asp:TextBox ID="txtValue" runat="server" Width="136px"></asp:TextBox><asp:RadioButton
                ID="rbtAmount" runat="server" Text="匹配" GroupName="1"></asp:RadioButton><asp:RadioButton
                    ID="rbtLike" runat="server" Text="模糊" GroupName="1" Checked="True"></asp:RadioButton>&nbsp;&nbsp;
            <asp:Button ID="btnQuery" runat="server" OnClick="btnQuery_Click" class="btn_mouseout"
                onmouseover="this.className= 'btn_mouseover' " onmouseout="this.className= 'btn_mouseout' "
                onmousedown="this.className= 'btn_mousedown'" Text="查    询" />&nbsp;
            <asp:Button ID="btnDelete" runat="server" class="btn_mouseout" onmouseover="this.className= 'btn_mouseover' "
                onmouseout="this.className= 'btn_mouseout' " onmousedown="this.className= 'btn_mousedown'"
                Text="删    除" OnClick="btnDelete_Click" />&nbsp;
            <cc1:ConditionSelector ID="ConditionSelector1" runat="server" OnSelectCondition="ConditionSelector1_SelectCondition"
                FieldSourceGrid="pgList" ButtonClassName="btn_mouseout" OnMouseDownJS="this.className= 'btn_mousedown'"
                OnMouseOutJS="this.className= 'btn_mouseout'" OnMouseOverJS="this.className= 'btn_mouseover'" />
        </td>
        <td align="right">
            <asp:Button ID="btnUpdate" runat="server" class="btn_mouseout" onmouseover="this.className= 'btn_mouseover' "
                onmouseout="this.className= 'btn_mouseout' " onmousedown="this.className= 'btn_mousedown'" OnClientClick="return CheckNull();"
                Text="更新勾选" OnClick="btnUpdate_Click" />&nbsp;
            <asp:Button ID="btnUpdateList" runat="server" class="btn_mouseout" onmouseover="this.className= 'btn_mouseover' "
                onmouseout="this.className= 'btn_mouseout' " onmousedown="this.className= 'btn_mousedown'"
                OnClientClick="return CheckNull();" Text="更新所有" OnClick="btnUpdateList_Click" />&nbsp;
            <asp:Button ID="btnExec" runat="server" class="btn_mouseout" onmouseover="this.className= 'btn_mouseover' "
             onmouseout="this.className= 'btn_mouseout' " onmousedown="this.className= 'btn_mousedown'"
                Text="执    行" OnClick="btnExec_Click" />&nbsp;
                
        </td>
    </tr>

 </table>
   <PaginationGrid:PaginationGrid ID="pgList" runat="server" InitPageSize="10" 
                OnOnGridItemSelect="pgList_OnGridItemSelect" DataPaginationMode="Customize">
            </PaginationGrid:PaginationGrid>

<table id="tblWoSetProInfo" runat="server" width="100%" style="border: 1px solid #A8CFEB;
    margin-top: 4px;">
</table>
<table width="100%" style="border: 1px solid #A8CFEB; margin-top: 4px;" id="tblError" runat="server">
    <tr>
        <td colspan="2">
            <PaginationGrid:PaginationGrid ID="pgError" runat="server" AutoGenerateColumns="True"
                InitPageSize="15" AutoSort="True">
            </PaginationGrid:PaginationGrid>
        </td>
    </tr>
</table>

<script type="text/javascript">
    function CheckNull() {
        var TargetSiteInput = document.getElementById("ctlSelected_ObjPro_TargetUser_txtObjVal");
        var TargetUserInput = document.getElementById("ctlSelected_ObjPro_TargetSite_txtObjVal");
        var ClassNameHidden = document.getElementById("ctlSelected_hdnTypeName");
        if (ClassNameHidden != null) {
           if (ClassNameHidden.value == "Allocation") {
                if (TargetUserInput != null) {
                    if (TargetUserInput.value == "") {
                        alert("目标地点不能为空");
                        return false;
                    }
                }
                if (TargetSiteInput != null) {
                    if (TargetSiteInput.value == "") {
                        alert("目标使用人不能为空");
                        return false;
                    }

                }
            }
        }
   
      return true;
    }
</script>

